package com.example.springbootmybatis.controller;

import com.example.springbootmybatis.mapper.EmpMapper;
import com.example.springbootmybatis.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/controller")
public class EmpController {

    @Autowired
    private EmpMapper empMapper;

    @RequestMapping("/all")
    public List<Emp> getEmpAll(){
        return empMapper.selectAll();
    }
}
